/*
	fs Airbase
*/

// environment (ala sickboy)
//

fsCLIENT = false; fsSERVER = false; fsJIP = false; fsINIT = false;

// Detect environment.
if (isServer) then {
	fsSERVER = true;
	if (!(isNull player)) then { fsCLIENT = true; };
	fsINIT = true;
} else {
	fsCLIENT = true;
	if (isNull player) then {
		fsJIP = true;
		[] spawn {
			waitUntil { !(isNull player) };
			T_INIT = true;
		};
	} else {
		fsINIT = true;
	};
};

if (fsSERVER) then {
	execVM "airbase.sqf";
	//execVM "factions.sqf";
};

// Set up client.
if (fsCLIENT) then
{
	[] spawn {
		waitUntil { fsINIT };
		// Display mission title.
		titleCut ["fs Airbase", "PLAIN DOWN"];
		titleFadeOut 5;
		// Display a delayed newbie help.
		sleep 5;
		hint "Welcome to fs Airbase!\n\nPress M to get started. Read your diary and your objectives.\n\nNo shooting at base or you will be kicked, banned, raped and sued.\n\nHave fun.";
		// Set up objectives.
		player execVM "update_tasks.sqf";
		};
	};
};

exitWith {};